package com.atguigu.gmall.activity.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/***
 * 秒杀服务线程池
 */
@Configuration
public class SeckillThreadPoolConfig {

    @Bean
    public ThreadPoolExecutor threadPoolExecutor() {
        return new ThreadPoolExecutor(
                24,
                24,
                0,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(10000));
    }
}
